package org.jeecg.modules.app.userSetting.service;

import com.alibaba.fastjson.JSONObject;
import org.jeecg.common.api.vo.Result;
import org.jeecg.modules.app.userSetting.entity.AppUserSetting;
import com.baomidou.mybatisplus.extension.service.IService;
import org.springframework.web.multipart.MultipartFile;

/**
 * @Description: 移动端用户扩展表
 * @Author: jeecg-boot
 * @Date: 2025-06-13
 * @Version: V1.0
 */
public interface AppUserSettingService extends IService<AppUserSetting> {

    /**
     * 根据用户id获取扩展设置
     *
     * @author zwf
     * @date created in 2025-06-13 09:28
     * @param: userId
     * @return: org.jeecg.modules.appUser.entity.AppUserSetting
     */
    AppUserSetting getByUserId(String userId);

    /**
     * 预登录
     *
     * @author zwf
     * @date created in 2025-06-12 17:25
     * @param: code
     * @return: org.jeecg.common.api.vo.Result<java.lang.String>
     */
    Result<String> beforeLogin(JSONObject params);

    /**
     * 根据用户openid获取扩展设置
     *
     * @author zwf
     * @date created in 2025-06-13 09:28
     * @param: openid
     * @return: org.jeecg.modules.appUser.entity.AppUserSetting
     */
    AppUserSetting getByOpenId(String openid);

    /**
     * 取消主账号
     *
     * @author zwf
     * @date created in 2025-06-18 09:30
     * @param: userId
     * @return: java.lang.Boolean
     */
    Boolean setNotPrimary(String userId);

    /**
     * 更新所有账号与主账号同步
     *
     * @author zwf
     * @date created in 2025-06-18 09:30
     * @param: userId
     * @return: java.lang.Boolean
     */
    Boolean updateUserPrimary(String userId, AppUserSetting userSetting);

    /**
     * 修改用户信息
     *
     * @author zwf
     * @date created in 2025-06-26 09:14
     * @param: params
     * @return: org.jeecg.common.api.vo.Result<java.lang.String>
     */
    Result<String> updateUserInfo(JSONObject params);

    /**
     * 修改头像
     *
     * @author zwf
     * @date created in 2025-06-26 15:11
     * @param: file
     * @return: org.jeecg.common.api.vo.Result<java.lang.String>
     */
    Result<String> uploadAvatar(MultipartFile file);
}
